<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>交换2个变量案例</title>
</head>

<body>
  <script>
    // 1. 声明2个变量
    let apple = '苹果汁'
    let orange = '橙子汁'
    // 2. 声明一个临时变量 temp 
    let temp
    // 3. 把apple杯子里面苹果汁倒入 temp 杯子里面(赋值)
    temp = apple
    // 4. 把orange杯子里面的橙子汁倒入apple杯子里面(赋值)
    apple = orange
    // 5. 把temp 里面的苹果汁倒入orange杯子里面(赋值)
    orange = temp
    console.log(apple, orange)
  </script>
</body>

</html>